﻿<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>在线考试系统</title>
    <!-- bootstrap 3.0.2 -->
    <link th:href="@{/resource/css/bootstrap.min.css}" rel="stylesheet" type="text/css" />
    <!-- Theme style -->
    <link th:href="@{/resource/css/style.css}" rel="stylesheet" type="text/css" />
    <link rel="stylesheet" type="text/css" th:href="@{/resource/js/jQueryMessage/css/message.skin.css}" />
</head>

<body>
	<div class="row">
	    <div class="col-md-12">
	    	<h1 class="panel-heading">添加用户</h1>
	        <!--breadcrumbs start -->
	        <ul class="breadcrumb">
				<li><a href="/admin/dashboard/toIndex"><i class="fa fa-home"></i> 首页</a></li>
				<li class="active">添加用户</li>
			</ul>
	        <!--breadcrumbs end -->
	    </div>
	</div>
	<div class="row">
		<div class="col-lg-12">
			<section class="panel">
				<div class="panel-body">
					<form class="col s12" id="form1" enctype="multipart/form-data" th:action="@{/userManager/addOneUser}"
						  onsubmit="return validateForm();" method="post">
						<div class="form-group form-control-medium">
							<label for="account">登录账号：</label>
							<input id="account" name="account" type="text" class="form-control"/>
						</div>
						<div class="form-group form-control-medium">
							<label for="password">登录密码：</label>
							<input id="password" name="password" type="password" class="form-control"/>
						</div>
						<!--<div class="form-group form-control-medium">-->
							<!--<label for="repassword">重复密码：</label>-->
							<!--<input id="repassword" name="repassword" type="password" class="form-control"/>-->
						<!--</div>-->
						<div class="form-group form-control-medium">
							<label for="name">真实姓名：</label>
							<input id="name" name="name" type="text" class="form-control"/>
						</div>
						<div class="form-btn-group-left">
			            	<button type="submit" class="btn btn-info">保存</button>
			            </div>
					</form>
				</div>
			</section>
		</div>
	</div>
	<script th:src="@{/resource/js/jquery.min.js}" type="text/javascript"></script>
    <script type="text/javascript" th:src="@{/resource/js/jQueryMessage/js/jquery.plugin.message.js}"></script>
    <script type="text/javascript">
	   	/* 保存方法 */
	    function validateForm(){
	    	var account = $("#account").val();
	    	var password = $("#password").val();
	    	if(account == null || account==''){
	    		$("body").MessageBox({
					type: 'error',
					message:'用户名不能为空',
					timeout:3000,
					callbak:null
				});
	    		return false;
	    	}
	    	if(password == null || password == ""){
	    		$("body").MessageBox({
					type: 'error',
					message:'密码不能为空',
					timeout:3000,
					callbak:null
				});
	    		return false;
	    	}
//	    	if(repassword == null || repassword == ""){
//	    		$("body").MessageBox({
//					type: 'error',
//					message:'重复密码不能为空',
//					timeout:3000,
//					callbak:null
//				});
//	    		return false;
//	    	}
//	    	if(password != repassword){
//	    		$("body").MessageBox({
//					type: 'error',
//					message:'两次密码输入不一致',
//					timeout:3000,
//					callbak:null
//				});
//	    		return false;
//	    	}
	    	return true;
	    }
    </script>
</body>
</html>
